<%@page import="java.util.Date"%>
<%@page import="Entity.Category"%>
<%@page import="Entity.Account"%>
<%
            if ((session.getAttribute("Admin_Session") == null)||(session.getAttribute("User_Session") != null))
            {
                response.sendRedirect(request.getContextPath() + "/index.jsp");
            } else {
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>National Level Paper Presentation</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="css/white/style.css" media="screen" title="shadow" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/calendar-eightysix-v1.1-default.css" media="screen" />

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/piroBox.1_2.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript">
    $.noConflict();
</script>

<!--////// END  \\\\\\\-->

</head>
<body>

<div id="templatemo_body_wrapper">
<div id="templatemo_wrapper">

	<div id="tempaltemo_header">
    	<div id="header_content">
		</div>
    </div> <!-- end of header -->

    <div id="templatemo_main_top"></div>
    <div id="templatemo_main">

        <div id="templatemo_sidebar">

        	<div id="templatemo_menu">
<%
        if(session.getAttribute("Admin_Session")!=null)
            {

            Account ac = (Account)session.getAttribute("Admin_Session");

%>
<table>
    <tr>
            <%
                   if(ac.getAvatar()!=null)
                       {
            %>
                  <td><img class="avatarAdmin" src="images/avatar/<%= ac.getAvatar() %>"/></td>
            <%
                        }else{
            %>
                  <td><img class="avatarAdmin" src="images/avatar/avatar.jpg"/></td>
            <%
                        }
             %>
    </tr>
    <tr>
        <td align="center"><strong>Information</strong></td>

    </tr>
    <tr>
<%
        if(ac.getGender().equals("Male"))
            {
%>
    <td>Mr:</td>
<%
       }else
        {
%>
    <td>Ms:</td>
<%
        }
%>
<td><%= ac.getFullname() %></td>
    </tr>
    <tr>
        <td>Address: </td>
	<td><%= ac.getAddress() %></td>
    </tr>
    <tr>
        <td><a href="ADUpdateProfile.jsp">More Profile</a></td>
	<form action="LoginServlet" method="post">
            <td><input type="submit" name="action" value="Sign Out" class="Button"/> </td>
        </form>
    </tr>
</table>
<%}%>
<br/>
<br/>
                    <ul>
                    <li><a href="AdminHome.jsp" target="_parent">Home</a></li>
                    <li><a href="MinhNHServlet?action=AdviewAccount" target="_parent">Manage Account</a></li>
                    <li><a href="VietDQServlet?action=GetAllEvents" target="_parent">Manage Events</a></li>
                    <li><a href="PhuocPHServlet?action=GetListCate" target="_parent" class="current">Manage Category</a></li>
                    <li><a href="VietDQServlet?action=AdviewFAQ" target="_parent">Manage FAQ</a></li>
                    <li><a href="PhuocPHServlet?action=ManageFB" target="_parent">Manage FeedBack</a></li>
                    <li><a href="PhuocPHServlet?action=manageComment" target="_parent">Manage Comment</a></li>
              </ul>
            </div> <!-- end of templatemo_menu -->
            <div class="cleaner"></div>
        </div> <!-- end of sidebar -->

        <div id="templatemo_content">

            <div class="content_box">
                <h2>UPDATE CATEGORY</h2>
              <div class="cleaner h30"></div>
              <%
                       if(session.getAttribute("Cate_obj")!=null)
                           {
                           Category objCate = (Category)session.getAttribute("Cate_obj");
              %>
              <form action="PhuocPHServlet" method="post" id="Update_Cate">
              <table  border="0" align="center">
           <tr>
            <td>Category ID</td>
            <td><input name="txtCate_ID" type="hidden" id="txtCate_ID" value="<%= objCate.getCaID() %>"/><%= objCate.getCaID() %></td>
            <td></td>
          </tr>
          <tr>
            <td>Category Name</td>
            <td><input type="text" name="txtCate_Name" value="<%= objCate.getCaName() %>" id="txtCate_Name"/>(<span class="style1">*</span>) </td>
            <td><label for="txtCate_Name" generated="true" class="error"></label></td>
          </tr>
          <tr>
            <td><input name="action" type="submit" value="Save"  class="Button"/></td>
            <td><input name="action" type="button" value="Back"  class="Button" onclick="return history.back(-1);"/></td>
          </tr>
              </table>
         </form>
              <%
                    }else{
                                out.println("no data");
                        }
                %>


              <script type="text/javascript">
    jQuery(document).ready(function($) {
           $("#Update_Cate").validate({
             messages: {
                 txtCate_Name: {
                     required: "Category name is required",
                     rangelength: "Category name must be from 6 to 15 characters"
                 }
            },
            rules: {
                txtCate_Name: {
                    required: true,
                    rangelength: [6, 15]
                 }
            }
        });
    });
         $(".cancel").click(function() {
		validator.resetForm();
	});

 </script>
          </div>

        </div>

        <div class="cleaner"></div>
    </div>

    <div id="templatemo_main_bottom">
    </div>

</div> <!-- end of wrapper -->
</div>

<div id="templatemo_footer_wrapper">
	<div id="templatemo_footer">
        Copyright � 2012 <a href="#">KSC Technology and Sciences</a> |
                Designed by <a href="#">Group_05_F2-1104-T1_FAT2_FPT-Aptech</a>

    </div>
</div>

</body>
</html>
<%
    }
%>